Skip to content

RFC: obj-action style method disambiguation #3908

Closed
syudoer wants to merge 16 commits into
rust-lang:masterfrom
syudoer:master
Closed

RFC: obj-action style method disambiguation #3908
syudoer wants to merge 16 commits into
rust-lang:masterfrom
syudoer:master

Conversation

@syudoer
Copy link
Copy Markdown

@syudoer syudoer commented Jan 20, 2026

I'll say upfront that I'm a Rust beginner, but the issue I'm discussing is exactly the kind of thing that experienced developers tend to avoid altogether. I suspect the reason it still exists in the language isn't that people don't know how to solve it, but simply that it doesn't occur frequently enough to annoy someone sufficiently to push for a language-level change. For me, as someone who's just learning the language, this problem has been nagging at me, and I feel I've spent enough time thinking it through and discussing it on the forum to arrive at a logical and straightforward solution.

My RFC proposes what I believe is the most intuitive and readable syntax for disambiguating method names that I can imagine. I think even without reading the full text, it's immediately clear what obj.Self::method(args), obj.Category::method(args), and obj.(Library::Trait::method)(args) do. You can even guess why the parentheses are required around Library::Trait::method but not around obj.Self::method.

I used an LLM to help turn the idea into a proper RFC, and now I have the persistent feeling that the list of edits I want to make isn't getting any shorter. It's hard to say I'd have done a better job myself, given my English proficiency and the fact that when you've been nursing an idea for long enough, no retelling — not even your own — ever feels complete. So it's possible I'm just overthinking it and can no longer distinguish real logical or presentation issues from a mere sense of incompleteness.

I'm really looking forward to your feedback so I can focus my revisions on what actually matters — things that are unclear to someone who isn't the author of RFC, or issues I've simply overlooked.

Rendered

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-lang Relevant to the language team, which will review and decide on the RFC.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants